package com.gmail.liulijuan.Busyness;

import java.util.ArrayList;

import com.gmail.liulijuan.DB.Employee;
import com.gmail.liulijuan.DB.EmployeeDao;

public class EmployeeAdd {
	public boolean InsertEmployee(String EmployeeName,String Password,String Sex,int Age,String Role,String PhoneNumber){
		int result=0;
		Employee em=new Employee();
		
		em.setEmployeeName(EmployeeName);
		em.setPassword(Password);
		em.setSex(Sex);
		em.setAge(Age);
		em.setRole(Role);
		em.setPhoneNumber(PhoneNumber);
		EmployeeDao ed=new EmployeeDao();
		result=ed.InsertEmployee(em);

		return result==1?true:false;
	}
	public boolean UpdataEmployee(ArrayList al){
	
		EmployeeDao ed=new EmployeeDao();
		int n=0;
		for (int i = 0; i < al.size(); i++) {
			ed.UpdataEmployee((Employee)al.get(i));
			n=n+1;
			
		}
		return n==al.size();
	}

}
